package io.renren.modules.app.controller.user.user;

import java.util.Arrays;
import java.util.Map;

import io.renren.modules.app.entity.YcRecruitTypeEntity;
import io.renren.modules.app.service.YcRecruitTypeService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;



/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2023-12-12 15:24:39
 */
@RestController
@RequestMapping("recruittype/ycrecruittype")
public class YcRecruitTypeController {
    @Autowired
    private YcRecruitTypeService ycRecruitTypeService;


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("recruittype:ycrecruittype:info")
    public R info(@PathVariable("id") Integer id){
		YcRecruitTypeEntity ycRecruitType = ycRecruitTypeService.getById(id);

        return R.ok().put("ycRecruitType", ycRecruitType);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("recruittype:ycrecruittype:save")
    public R save(@RequestBody YcRecruitTypeEntity ycRecruitType){
		ycRecruitTypeService.save(ycRecruitType);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("recruittype:ycrecruittype:update")
    public R update(@RequestBody YcRecruitTypeEntity ycRecruitType){
		ycRecruitTypeService.updateById(ycRecruitType);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("recruittype:ycrecruittype:delete")
    public R delete(@RequestBody Integer[] ids){
		ycRecruitTypeService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
